import openpyxl
import os

#创建新表格
new_workbook = openpyxl.Workbook()
#新表格的默认sheet叫作Sheet
new_sheet = new_workbook['Sheet']
#写表头
new_sheet['A1'] = '表名'
new_sheet['B1'] = '中文名'
new_sheet['C1'] = '主键（粒度）'
new_sheet['D1'] = '字段名称'
new_sheet['E1'] = '字段类型'
new_sheet['F1'] = '字段注释'
new_sheet['G1'] = '关联键'
new_sheet['H1'] = 'ods来源表'
new_sheet['I1'] = '来源表描述'
new_sheet['J1'] = '来源表字段名称'
new_sheet['K1'] = '来源表字段类型'
new_sheet['M1'] = '来源表字段注释'
new_sheet['L1'] = '备注'

#新表格的数据从第二行开始写入
new_row_idx = 2



new_sheet['A2'].value = "test value"

#保存修改
new_workbook.save('Test.xlsx')
